package com.xdtech.trans.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.xdtech.core.model.BaseModel;

/**
 * 
 * @author max.zheng
 * @create 2015-05-26 21:12:50
 * @since 1.0
 * @see 
 */
@Entity
@Table(name=" TRANS_WEBSITE")
public class TransWebSite extends BaseModel implements Serializable{
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	@Column(name="NAME")
	private String name;
	@Column(name="SIMPLE_NAME")
	private String simpleName;
	@Column(name="ACCOUNT_TYPE")
	private String accountType;
	@Column(name="WEBSITE_TYPE")
	private String websiteType;
	@Column(name="WEBSITE_LEVEL")
	private String websiteLevel;
	@Column(name="CONTACTS")
	private String contacts;
	@Column(name="MOBILE_PHONE")
	private String mobilePhone;
	@Column(name="TELEPHONE")
	private String telephone;
	@Column(name="STATE_PROVINCE")
	private String stateProvince;
	@Column(name="ADDRESS")
	private String address;
	@Column(name="POSTCODE")
	private String postcode;
	@Column(name="EMAIL")
	private String email;
	@Column(name="FAX")
	private String fax;
	@Column(name="QQ")
	private String qq;
	@Column(name="REMARK")
	private String remark;
	
	/************关联关系********************/
	@ManyToOne
    @JoinColumn(name = "PARENT_ID")
    private TransWebSite       parent;
	@OneToMany(mappedBy="parent",orphanRemoval=true,fetch=FetchType.LAZY)  //,fetch=FetchType.EAGER
    private List<TransWebSite> children    = new ArrayList<TransWebSite>();
	@OneToMany(mappedBy="webSite",orphanRemoval=true,fetch=FetchType.LAZY) 
	private List<Person> persons = new ArrayList<Person>();
	
	@OneToMany(mappedBy="transWebSite",orphanRemoval=true,fetch=FetchType.LAZY) 
	private List<TransAccount> transAccounts = new ArrayList<TransAccount>();
	
	
	
	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	public void setSimpleName(String simpleName) {
		this.simpleName = simpleName;
	}
	public String getSimpleName() {
		return simpleName;
	}
	public void setAccountType(String accountType) {
		this.accountType = accountType;
	}
	public String getAccountType() {
		return accountType;
	}
	public void setWebsiteType(String websiteType) {
		this.websiteType = websiteType;
	}
	public String getWebsiteType() {
		return websiteType;
	}
	public void setWebsiteLevel(String websiteLevel) {
		this.websiteLevel = websiteLevel;
	}
	public String getWebsiteLevel() {
		return websiteLevel;
	}
	public void setContacts(String contacts) {
		this.contacts = contacts;
	}
	public String getContacts() {
		return contacts;
	}
	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}
	public String getMobilePhone() {
		return mobilePhone;
	}
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	public String getTelephone() {
		return telephone;
	}
	public void setStateProvince(String stateProvince) {
		this.stateProvince = stateProvince;
	}
	public String getStateProvince() {
		return stateProvince;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getAddress() {
		return address;
	}
	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}
	public String getPostcode() {
		return postcode;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getEmail() {
		return email;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	public String getFax() {
		return fax;
	}
	public void setQq(String qq) {
		this.qq = qq;
	}
	public String getQq() {
		return qq;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getRemark() {
		return remark;
	}
	public TransWebSite getParent()
	{
		return parent;
	}
	public void setParent(TransWebSite parent)
	{
		this.parent = parent;
	}
	public List<TransWebSite> getChildren()
	{
		return children;
	}
	public void setChildren(List<TransWebSite> children)
	{
		this.children = children;
	}
	public List<Person> getPersons() {
		return persons;
	}
	public void setPersons(List<Person> persons) {
		this.persons = persons;
	}
	public List<TransAccount> getTransAccounts() {
		return transAccounts;
	}
	public void setTransAccounts(List<TransAccount> transAccounts) {
		this.transAccounts = transAccounts;
	}
}
